import { defineStore } from "pinia";
import { Names } from "../../store-namespace";
import { _get, _post, _put, _delete, http } from "@/utils/axios";
import { ElNotification } from "element-plus"; //处理导航信息
import { WarningCategory } from "@/api/backend/index";

export const useWarningCategory = defineStore(Names.WarningCategory, {
  state: () => {
    return {
      single: <any>{},
      tags: <any>{},
      type: <any>[],
    };
  },
  getters: {},
  actions: {
    //获取告警类别列表数据
    getWarningCategoryList(filter: any) {
      return new Promise((resolve, reject) => {
        _get(WarningCategory + "/list", filter, "json", "").then((res: any) => {
          console.log("获取告警指标项列表数据", res);
          resolve(res.rows);
        });
      });
    },
  },
});
